package com.lgx.mall.core.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lgx.common.exception.DataException;
import com.lgx.common.web.Pagination;
import com.lgx.mall.core.dao.IAdvertisementDao;
import com.lgx.mall.core.entity.Advertisement;
import com.lgx.mall.core.service.IAdvertisementService;

/**
 * 
 * @author yry
 *
 */
@Service("advertisementService")
public class AdvertisementService implements IAdvertisementService {
	
	@Autowired
	private IAdvertisementDao advertisementDao;

	public void setAdvertisementDao(IAdvertisementDao advertisementDao) {
		this.advertisementDao = advertisementDao;
	}

	public Advertisement createAdvertisement(Advertisement advertisement) throws DataException {
		return this.advertisementDao.createAdvertisement(advertisement);
	}

	public Advertisement updateAdvertisement(Advertisement advertisement)
			throws DataException {
		return this.advertisementDao.updateAdvertisement(advertisement);
	}

	public void deleteAdvertisement(Advertisement advertisement)
			throws DataException {
		this.advertisementDao.deleteAdvertisement(advertisement);
	}

	public void deleteAdvertisement(long id) throws DataException {
		this.advertisementDao.deleteAdvertisement(id);
	}

	public Advertisement findAdvertisementById(long id) {
		return this.advertisementDao.findAdvertisementById(id);
	}

	public void deleteAdvertisements(String[] ids) throws DataException {
		this.advertisementDao.deleteAdvertisements(ids);
	}

	public List<Advertisement> findAdvertisementList() {
		return this.advertisementDao.findAdvertisementList();
	}

	public Pagination findAdvertisementPagination(Object[] params,
			int pageSize, int pageNum) {
		return this.advertisementDao.findAdvertisementPagination(params, pageSize, pageNum);
	}

	public Pagination findAdvertisementPagination(String areaNode,
			String county, int pageSize, int pageNum) {
		return this.advertisementDao.findAdvertisementPagination(areaNode, county, pageSize, pageNum);
	}
}
